package Test;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
*
* @author root
*/
public class framea extends JFrame{
private JButton a,b;
metodos metodos;

public framea(){
	super("Formulario 1");
	JPanel panel=new JPanel();
	metodos=new metodos();
	a=new JButton("llamar Formulario 2");
	a.addActionListener(new ActionListener() {
	
		@Override
		public void actionPerformed(ActionEvent e) {
		
			new frameb(new JButton("boton"));
		
		}
		});
	//valor=objetos{imagenes,textos,dimensiones,etc}
	b=new JButton("cambiar valor de boton de Formulario 2");
	b.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			metodos.b();
		
		}});
	panel.add(a);
	panel.add(b);
	getContentPane().add(panel);
	setDefaultCloseOperation(EXIT_ON_CLOSE);
	//getContentPane().add(a);
	
	//getContentPane(this);
	setVisible(true);
	setSize(400, 200);
}

public static void main(String[] arg){
new framea();
}
}
